﻿<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<iss.sg4210.se18.team6s.jass.DAL.Advertisement>>" %>--%>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<iss.sg4210.se18.team6s.jass.DAL.Advertisement>>" %>
<%@ Import Namespace="iss.sg4210.se18.team6s.Utilities" %>
<table style="width: 100%" class="lsttable">
    <%if (Model != null && Model.Count() > 0)
      {
    %>
    <tr class="lstth">
        <th>
        </th>
        <th>
            Title
        </th>
        <th>
            Description
        </th>
        <th>
            Experience In Years
        </th>
        <th>
            Salary From
        </th>
        <th>
            Salary To
        </th>
        <th>
            Location
        </th>
        <th>
            Company
        </th>
    </tr>
    <% foreach (var item in Model)
       { %>
    <tr style="text-align: center">
        <td class="lsttd">
            <%: Html.ActionLink("Apply", "Create", "Response", new { id = item.Id }, new object { })%>
        </td>
        <td class="lsttd">
            <%: Html.ActionLink(item.Title, "Details", new { id = item.Id })%>
        </td>
        <td class="lsttd">
            <%: item.Description %>
        </td>
        <td class="lsttd">
            <%: item.ExperienceInYears %>
        </td>
        <td class="lsttd">
            <%: item.SalaryFrom %>
        </td>
        <td class="lsttd">
            <%: item.SalaryTo %>
        </td>
        <td class="lsttd">
            <%: item.GeoArea.Name %>
        </td>
        <td class="lsttd">
            <%: item.Company.Name %>
        </td>
    </tr>
    <% }%>
    <div class="pager">
        <%= Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount, "/Page") %>
    </div>
    <%
        }
      else
      { %>
    <div>
        No data Found!
    </div>
    <% 
        } 
    %>
</table>
